package br.com.timesystem.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import org.hibernate.annotations.Index;

/**
 *
 * @author duduso
 */
@Entity
@Table(name = "cargo")
public class Cargo extends EntityBase{

    @Id
    @SequenceGenerator(name = "gen_id_cargo", sequenceName = "gen_id_cargo", allocationSize = 1)
    @GeneratedValue(generator = "gen_id_cargo")    
    @Column(name = "id_cargo", nullable = false, unique = true)
    @Index(name = "idx_id_cargo")
    private Long id;

    @Column(name = "nome", nullable = false, length = 100)
    private String nome;

    @Column(name = "ativo", nullable = false)
    private Boolean ativo;

    public Cargo() {
    }

    public Cargo(Long id) {
        this.id = id;
    }

    @Override
    public Long getId(){
        return this.id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public Boolean getAtivo() {
        return ativo;
    }

    public void setAtivo(Boolean ativo) {
        this.ativo = ativo;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

}
